import request from '../utils/request';

// 注册接口
export const getRegister = (data) => {
  return request({ method: 'post', url: '/user/register', data });
};

// 登录接口
export const getLogin = (data) => {
  return request({ method: 'post', url: '/user/login', data });
};

// 获取用户数据接口
export const getUserInfo = () => {
  return request({ method: 'get', url: '/user/userInfo' });
};

// 获取分类图书数据
export const getBook = (data) => {
  return request({ method: 'get', url: '/book/find', data });
};

// 修改图书
export const changeBook = (data) => {
  return request({ method: 'get', url: '/book/update', data });
};

// 删除图书
export const deleteBook = (data) => {
  return request({ method: 'get', url: '/book/delete', data });
};

// 添加图书
export const addBook = (data) => {
  return request({ method: 'get', url: '/book/add', data });
};

// 获取全部图书数据
export const bookData = () => {
  return request({ method: 'get', url: '/book/bookData' })
}